package com.k.demo.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.k.demo.entity.GoodOrderDetail;
import com.k.demo.mapper.GoodOrderDetailMapper;
import com.k.demo.service.GoodOrderDetailService;

@Service
public class GoodOrderDetailServiceImpl implements GoodOrderDetailService {

	@Autowired
	private GoodOrderDetailMapper goodOrderDetailMapper;
	
	@Override
	public boolean insertForeach(List<GoodOrderDetail> goodOrderDetailList) {
		return goodOrderDetailMapper.insertForeach(goodOrderDetailList);
	}

	@Override
	public List<GoodOrderDetail> getDetails(Integer orderid) {
		
		return goodOrderDetailMapper.getDetails(orderid);
	}
	//菜品销售总量
	@Override
	public int getSaleNumberByDate(String date) {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.selectAllFoodNumberByDate(date);
	}
	//每样菜品销售量
	@Override
	public List<GoodOrderDetail> getFoodSaleNumber(String date) {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.getFoodSaleNumber(date);
	}

	@Override
	public int getSaleNumberToday() {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.selectAllFoodNumberToday();
	}

	@Override
	public List<GoodOrderDetail> getFoodSaleNumberToday() {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.getFoodSaleNumberToday();
	}

	@Override
	public List<GoodOrderDetail> getFoodSaleNumberByTime(String start_date, String end_date) {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.selectFoodSaleNumberByTime(start_date, end_date);
	}

	@Override
	public List<HashMap<String, Object>> getFoodSaleNumberByKind(String start_date, String end_date) {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.getFoodSaleNumWithKind(start_date, end_date);
	}

	@Override
	public int getFoodMonthSaleNumber(int food_id) {
		// TODO Auto-generated method stub
		return goodOrderDetailMapper.selectFoodMonthSaleNumber(food_id);
	}

}
